﻿using HR60_PanelSoft.Model;
using HR60_PanelSoft.NetWork.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HR60_PanelSoft.NetWork.Sender
{
    class Sender_010D:BaseSender
    {
        public Sender_010D(byte panelNo,Panel panel,bool isAir,bool isAir485,byte airSum,byte airBrand,
             bool isHeat, bool isHeat485, byte heatSum, byte heatBrand
           , bool isWind, bool isWind485, byte windSum,byte windBrand
           , bool isBJY, byte bjySum, byte bjyBrand)
        {
            byte[] data = new byte[11];
            data[0] = (byte)Proj.currentProj.scenes.Count;
            data[1] = airSum;
            data[2] = heatSum;
            data[3] = windSum;
            data[4] = bjySum;
            if (isAir)
            {
                data[5] = (byte)(isAir485 ? 01 : 02);
                data[6] = airBrand;
            }

            if (isHeat)
            {
                data[7] = (byte)(isHeat485 ? 01 : 02);
                data[8] = heatBrand;
            }

            if (isWind)
            {
                data[9] = (byte)(isWind485 ? 01 : 02);
                data[10] = (byte)(windBrand | bjyBrand << 4);
            }
            

            this.package = Package.getPackage(0x01, 0x0D, panelNo, 0x01, data);
        }
    }
}
